/*2_2
	Name:
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define N 2
#define M 3
int main()
{
    int a[N][M],i,j,max;
    for(i=0;i<N;i++)
        for(j=0;j<M;j++)
            scanf("%d",&a[i][j]);
            
    for(i=0;i<N;i++)
    {
        int tag = 1;
        max=0;
        for(j=0;j<M;j++)
            if(a[i][max]<a[i][j])   max=j;
        for(j=0;j<N;j++)
            if(a[i][max]>a[j][max])
                break;
        if(j>=N)
            printf("%d  ",a[i][max]);
    }
}

